<template>
  <a-card :bordered="false" class="table-layout">
    <template slot="title">
      <slot name="title" v-if="$slots['title']"></slot>
      <span v-else-if="title">{{title}}</span>
    </template>
    
    <!-- 搜索栏 -->
    <section class="table-layout-header" v-if="$slots['search']">
      <slot name="search"></slot>
    </section>
    <!-- 主要内容区 -->
    <section class="table-layout-content">
      <slot></slot>
    </section>
    <!-- 底部 -->
    <section class="table-layout-footer">
      <!-- 其他 -->
      <section class="other">
        <slot name="other"></slot>
      </section>
      <!-- 分页 -->
      <section class="paging">
        <slot name="paging"></slot>
      </section>
    </section>
  </a-card>
</template>
<script lang="ts">
import { Vue, Component, Prop } from 'vue-property-decorator'
@Component
export default class Layout extends Vue {
  @Prop({type: String, default: ''})
  public title!: string

  public mounted() {
  }
}
</script>

<style lang="less" scoped>
.table-layout {
  display: flex;
  width: 100%;
  // height: 100%;
  flex-direction: column;
  // margin-bottom: 20px;
  .table-layout-header {
    flex: none;
    padding-bottom: 15px;
    box-sizing: border-box;
  }
  .table-layout-footer {
    flex: none;
    display: flex;
    margin-top: 10px;
    line-height: 40px;
    .other {
      flex: auto;
    }
    .paging {
      flex: none;
      display: flex;
      align-items: center;
    }
    ul {
      margin-bottom: 0;
    }
  }
  .table-layout-content {
    flex: auto;
    overflow-y: scroll;
  }

  /deep/ .ant-card-head{
    padding: 0 10px;
    min-height: auto;
    .ant-card-head-title {
      padding: 10px 0;
    }
  }
  /deep/ .ant-card-body {
    padding: 16px 10px 10px;
    height: auto!important;
  }
}

/deep/ .ant-table {
  tr {
    td, th, .ant-table-header-column > div {
      word-wrap: break-word;
      word-break: break-all;
    }
  }
  .ant-btn-link {
    margin: auto 0;
    padding: 0 0px;
  }
} 

::-webkit-scrollbar {
  display: none;
}
</style>


